test(sender): add unit-test target covering wire protocol and automation parsing#127
Open
jasontitus wants to merge 2 commits into
Open
test(sender): add unit-test target covering wire protocol and automation parsing#127jasontitus wants to merge 2 commits into
jasontitus wants to merge 2 commits into
Conversation
…ion parsing Adds a TBDisplaySenderTests unit bundle (hosted by the app for @testable access) with 49 tests over the pure logic that has no hardware dependency: - TBMonitorProtocol: BE32 primitives, packet layout, drainPacket handling of fragmented/contiguous/split feeds, JSON payload round-trips, and parity of the hand-rolled input-event encoder with JSONDecoder — guarding the invariant documented on makeInputEventPacket (PR swellweb#123). - TBDiscoveredReceiver: per-transport ip(for:) selection (which IP the sender dials for Thunderbolt vs Network Link), id, shortHostName, displayText. - TBSenderAutomation: parseTransport/parseMode/parsePreset aliases, receiver matching, and the resolveSessionIndex tri-state. The automation parsing helpers move from private to internal so the test bundle can exercise them; behavior is unchanged. project.pbxproj and the shared TBDisplaySender scheme are regenerated via xcodegen so a fresh checkout can run `xcodebuild test` directly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Executes the new TBDisplaySenderTests suite after the sender build. - Triggers CI on 3.1-maint and 3.2-dev in addition to main, so the branches that actually receive PRs get build/test coverage. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The repo currently has no test infrastructure at all, and CI is build-only — and only triggers on
main, while PRs are being merged into3.1-maint. This PR lays the foundation: a unit-test target over the pure logic that needs no Thunderbolt hardware, wired into CI on the branches that actually receive work.What's in it
TBDisplaySenderTestsunit bundle (hosted by the app for@testableaccess) with 49 tests:TBMonitorProtocol— BE32 primitives, packet layout,drainPacketacross fragmented/contiguous/byte-by-byte feeds, JSON payload round-trips, and parity of the hand-rolled input-event encoder withJSONDecoder— this pins the invariant documented onmakeInputEventPacketin perf(input): hand-roll input-event encoding to drop per-event JSONEncoder #123.TBDiscoveredReceiver— per-transportip(for:)selection (which IP the sender dials for Thunderbolt vs Network Link),id,shortHostName,displayText.TBSenderAutomation—parseTransport/parseMode/parsePresetaliases, receiver matching, and theresolveSessionIndextri-state (nil/ all-sessions / index).privatetointernalso the test bundle can reach them — no behavior change.project.pbxprojand the shared scheme are regenerated via xcodegen (they're tracked), so a fresh checkout can runxcodebuild testdirectly.3.1-maint/3.2-devin addition tomain.How tested
xcodebuild test -scheme TBDisplaySender -destination 'platform=macOS'— 49/49 green locally (M2, macOS 15)../scripts/build_targetbridge_sender_app.shstill succeeds unchanged.Two follow-up PRs are stacked on this one (protocol-drain hardening, and an interface-scoping connect fix diagnosed on real hardware).
🤖 Generated with Claude Code